
DIRS = src/
CC = gcc
CC_LIBS = -lm -pthread -lGL -lGLU -lglut
COMP_FILES = $(patsubst %/,%/dir_comp.o,$(DIRS))
DIROBJ = $(patsubst %/,%,$(DIRS))
RESULT_FILE = steiner
OBJTEXT = $(patsubst %,%_text,$(DIROBJ))
OBJCLEAN = $(patsubst %,%_clean,$(DIROBJ))
RM = rm -f

all: $(OBJTEXT)
	$(CC) $(CC_LIBS) -o $(RESULT_FILE) $(COMP_FILES)

$(OBJTEXT):
	$(MAKE) -C $(patsubst %_text,%,$@)/

clean: $(OBJCLEAN)
	$(RM) $(RESULT_FILE)

$(OBJCLEAN):
	$(MAKE) -C $(patsubst %_clean,%,$@)/ clean
